/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.stream.IntStream;

/**
 * <p>Project: jse2302 - Stream03
 * <p>Powered by webrx On 2023-06-29 10:57:24
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Stream03 {
    public static void main(String[] args) {
        IntStream is = IntStream.generate(() -> (int) Math.round(Math.random() * 99) + 1).limit(15).skip(5);
        //is.filter(Stream03::isNum).forEach(System.out::println);


        //is.map(e -> e % 2 == 0 ? e + 1 : e).forEach(System.out::println);

        /*
        is.filter(e->{
            return isNum(e);
        }).forEach(e->{
            System.out.println(e);
        });*/
        //int sum = is.filter(Stream03::isNum).sum();
        //System.out.println(sum);
        //is.forEach(System.out::println);


    }

    public boolean isNum(int i) {
        return i % 2 == 0 ? true : false;
    }
}
